\hypertarget{group__wickr__node}{}\section{Wickr\+\_\+node}
\label{group__wickr__node}\index{Wickr\_node@{Wickr\_node}}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structwickr__node}{wickr\+\_\+node}}
\begin{DoxyCompactList}\small\item\em Represents a message destination at a point in time. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__node_ga293b1210648e2db5449be23fe0f3e644}{wickr\+\_\+node\+\_\+create}} (\mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}} $\ast$dev\+\_\+id, \mbox{\hyperlink{structwickr__identity__chain}{wickr\+\_\+identity\+\_\+chain\+\_\+t}} $\ast$id\+\_\+chain, \mbox{\hyperlink{structwickr__ephemeral__keypair}{wickr\+\_\+ephemeral\+\_\+keypair\+\_\+t}} $\ast$ephemeral\+\_\+keypair)
\item 
bool \mbox{\hyperlink{group__wickr__node_ga2ed650b947df7316cf0f915805ac5aa4}{wickr\+\_\+node\+\_\+rotate\+\_\+keypair}} (\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$node, \mbox{\hyperlink{structwickr__ephemeral__keypair}{wickr\+\_\+ephemeral\+\_\+keypair\+\_\+t}} $\ast$new\+\_\+keypair, bool copy)
\item 
\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__node_ga393c4fb42022fdc6f4336a62dbc7af91}{wickr\+\_\+node\+\_\+copy}} (const \mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$source)
\item 
void \mbox{\hyperlink{group__wickr__node_ga6acf07885403d9df6baad36a8d797f73}{wickr\+\_\+node\+\_\+destroy}} (\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$$\ast$node)
\item 
bool \mbox{\hyperlink{group__wickr__node_gac9e2d96e9109590124b2fd05a8826c1d}{wickr\+\_\+node\+\_\+verify\+\_\+signature\+\_\+chain}} (\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$node, const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$engine)
\item 
wickr\+\_\+node\+\_\+array\+\_\+t $\ast$ \mbox{\hyperlink{group__wickr__node_ga504ebe707aa003032c4ac8044d73ee92}{wickr\+\_\+node\+\_\+array\+\_\+new}} (uint32\+\_\+t node\+\_\+count)
\item 
bool \mbox{\hyperlink{group__wickr__node_gae511a75489982fc2e90271be63d9d753}{wickr\+\_\+node\+\_\+array\+\_\+set\+\_\+item}} (wickr\+\_\+array\+\_\+t $\ast$array, uint32\+\_\+t index, \mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$node)
\item 
\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__node_ga878a3015abc8563d512c0e5acf10df60}{wickr\+\_\+node\+\_\+array\+\_\+fetch\+\_\+item}} (const wickr\+\_\+array\+\_\+t $\ast$array, uint32\+\_\+t index)
\item 
wickr\+\_\+node\+\_\+array\+\_\+t $\ast$ \mbox{\hyperlink{group__wickr__node_gab577103b1752357b8575b064e22a4970}{wickr\+\_\+node\+\_\+array\+\_\+copy}} (const wickr\+\_\+node\+\_\+array\+\_\+t $\ast$array)
\item 
\mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__node_ga6012a4fe980b1a616369cbc4b0a95f74}{wickr\+\_\+node\+\_\+serialize}} (const \mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$node)
\item 
\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__node_ga3906f6da9fbd61172d2d65466773aa83}{wickr\+\_\+node\+\_\+create\+\_\+from\+\_\+buffer}} (const \mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}} $\ast$buffer, const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$engine)
\item 
void \mbox{\hyperlink{group__wickr__node_gab3f40f122baca50bcc62af54eaa08fe9}{wickr\+\_\+node\+\_\+array\+\_\+destroy}} (wickr\+\_\+node\+\_\+array\+\_\+t $\ast$$\ast$array)
\end{DoxyCompactItemize}


\subsection{Detailed Description}


\subsection{Function Documentation}
\mbox{\Hypertarget{group__wickr__node_gab577103b1752357b8575b064e22a4970}\label{group__wickr__node_gab577103b1752357b8575b064e22a4970}} 
\index{Wickr\_node@{Wickr\_node}!wickr\_node\_array\_copy@{wickr\_node\_array\_copy}}
\index{wickr\_node\_array\_copy@{wickr\_node\_array\_copy}!Wickr\_node@{Wickr\_node}}
\subsubsection{\texorpdfstring{wickr\_node\_array\_copy()}{wickr\_node\_array\_copy()}}
{\footnotesize\ttfamily wickr\+\_\+node\+\_\+array\+\_\+t$\ast$ wickr\+\_\+node\+\_\+array\+\_\+copy (\begin{DoxyParamCaption}\item[{const wickr\+\_\+node\+\_\+array\+\_\+t $\ast$}]{array }\end{DoxyParamCaption})}

Make a deep copy of a node array


\begin{DoxyParams}{Parameters}
{\em array} & the array to copy \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a newly allocated wickr\+\_\+node\+\_\+array that contains a copy of each element from \textquotesingle{}array\textquotesingle{} 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__node_gab3f40f122baca50bcc62af54eaa08fe9}\label{group__wickr__node_gab3f40f122baca50bcc62af54eaa08fe9}} 
\index{Wickr\_node@{Wickr\_node}!wickr\_node\_array\_destroy@{wickr\_node\_array\_destroy}}
\index{wickr\_node\_array\_destroy@{wickr\_node\_array\_destroy}!Wickr\_node@{Wickr\_node}}
\subsubsection{\texorpdfstring{wickr\_node\_array\_destroy()}{wickr\_node\_array\_destroy()}}
{\footnotesize\ttfamily void wickr\+\_\+node\+\_\+array\+\_\+destroy (\begin{DoxyParamCaption}\item[{wickr\+\_\+node\+\_\+array\+\_\+t $\ast$$\ast$}]{array }\end{DoxyParamCaption})}

Destroy a node array

N\+O\+TE\+: Nodes in the array are not destroyed, only the container array


\begin{DoxyParams}{Parameters}
{\em array} & the array to destroy \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{group__wickr__node_ga878a3015abc8563d512c0e5acf10df60}\label{group__wickr__node_ga878a3015abc8563d512c0e5acf10df60}} 
\index{Wickr\_node@{Wickr\_node}!wickr\_node\_array\_fetch\_item@{wickr\_node\_array\_fetch\_item}}
\index{wickr\_node\_array\_fetch\_item@{wickr\_node\_array\_fetch\_item}!Wickr\_node@{Wickr\_node}}
\subsubsection{\texorpdfstring{wickr\_node\_array\_fetch\_item()}{wickr\_node\_array\_fetch\_item()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}}$\ast$ wickr\+\_\+node\+\_\+array\+\_\+fetch\+\_\+item (\begin{DoxyParamCaption}\item[{const wickr\+\_\+array\+\_\+t $\ast$}]{array,  }\item[{uint32\+\_\+t}]{index }\end{DoxyParamCaption})}

Fetch an item in the node array

N\+O\+TE\+: a fetched node is not copied out of the array, it is still owned by the array


\begin{DoxyParams}{Parameters}
{\em array} & the array to fetch from \\
\hline
{\em index} & the index in the array to fetch from \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the node at \textquotesingle{}index\textquotesingle{}. N\+U\+LL if the index is out of bounds 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__node_ga504ebe707aa003032c4ac8044d73ee92}\label{group__wickr__node_ga504ebe707aa003032c4ac8044d73ee92}} 
\index{Wickr\_node@{Wickr\_node}!wickr\_node\_array\_new@{wickr\_node\_array\_new}}
\index{wickr\_node\_array\_new@{wickr\_node\_array\_new}!Wickr\_node@{Wickr\_node}}
\subsubsection{\texorpdfstring{wickr\_node\_array\_new()}{wickr\_node\_array\_new()}}
{\footnotesize\ttfamily wickr\+\_\+node\+\_\+array\+\_\+t$\ast$ wickr\+\_\+node\+\_\+array\+\_\+new (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{node\+\_\+count }\end{DoxyParamCaption})}

Create an array of nodes


\begin{DoxyParams}{Parameters}
{\em node\+\_\+count} & the number of nodes the array should hold \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a newly allocated array with enough space to hold \textquotesingle{}node\+\_\+count\textquotesingle{} nodes 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__node_gae511a75489982fc2e90271be63d9d753}\label{group__wickr__node_gae511a75489982fc2e90271be63d9d753}} 
\index{Wickr\_node@{Wickr\_node}!wickr\_node\_array\_set\_item@{wickr\_node\_array\_set\_item}}
\index{wickr\_node\_array\_set\_item@{wickr\_node\_array\_set\_item}!Wickr\_node@{Wickr\_node}}
\subsubsection{\texorpdfstring{wickr\_node\_array\_set\_item()}{wickr\_node\_array\_set\_item()}}
{\footnotesize\ttfamily bool wickr\+\_\+node\+\_\+array\+\_\+set\+\_\+item (\begin{DoxyParamCaption}\item[{wickr\+\_\+array\+\_\+t $\ast$}]{array,  }\item[{uint32\+\_\+t}]{index,  }\item[{\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$}]{node }\end{DoxyParamCaption})}

Set an item in the node array

N\+O\+TE\+: \textquotesingle{}node\textquotesingle{} is not copied into the array, ownership is simply transferred to the array


\begin{DoxyParams}{Parameters}
{\em array} & the array to set a node into \\
\hline
{\em index} & the index to place the node into the array \\
\hline
{\em node} & the node to place at \textquotesingle{}index\textquotesingle{} in the array \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if the insert succeeds, false if the index is out of range 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__node_ga393c4fb42022fdc6f4336a62dbc7af91}\label{group__wickr__node_ga393c4fb42022fdc6f4336a62dbc7af91}} 
\index{Wickr\_node@{Wickr\_node}!wickr\_node\_copy@{wickr\_node\_copy}}
\index{wickr\_node\_copy@{wickr\_node\_copy}!Wickr\_node@{Wickr\_node}}
\subsubsection{\texorpdfstring{wickr\_node\_copy()}{wickr\_node\_copy()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}}$\ast$ wickr\+\_\+node\+\_\+copy (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$}]{source }\end{DoxyParamCaption})}

Copy an node


\begin{DoxyParams}{Parameters}
{\em source} & the node to copy \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a newly allocated node holding a deep copy of the properties of \textquotesingle{}source\textquotesingle{} 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__node_ga293b1210648e2db5449be23fe0f3e644}\label{group__wickr__node_ga293b1210648e2db5449be23fe0f3e644}} 
\index{Wickr\_node@{Wickr\_node}!wickr\_node\_create@{wickr\_node\_create}}
\index{wickr\_node\_create@{wickr\_node\_create}!Wickr\_node@{Wickr\_node}}
\subsubsection{\texorpdfstring{wickr\_node\_create()}{wickr\_node\_create()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}}$\ast$ wickr\+\_\+node\+\_\+create (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}} $\ast$}]{dev\+\_\+id,  }\item[{\mbox{\hyperlink{structwickr__identity__chain}{wickr\+\_\+identity\+\_\+chain\+\_\+t}} $\ast$}]{id\+\_\+chain,  }\item[{\mbox{\hyperlink{structwickr__ephemeral__keypair}{wickr\+\_\+ephemeral\+\_\+keypair\+\_\+t}} $\ast$}]{ephemeral\+\_\+keypair }\end{DoxyParamCaption})}

Create a node from components


\begin{DoxyParams}{Parameters}
{\em dev\+\_\+id} & see \textquotesingle{}\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node}}\textquotesingle{} property documentation \\
\hline
{\em id\+\_\+chain} & see \textquotesingle{}\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node}}\textquotesingle{} property documentation \\
\hline
{\em ephemeral\+\_\+keypair} & see \textquotesingle{}\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node}}\textquotesingle{} property documentation \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a newly allocated node. Takes ownership of the passed inputs 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__node_ga3906f6da9fbd61172d2d65466773aa83}\label{group__wickr__node_ga3906f6da9fbd61172d2d65466773aa83}} 
\index{Wickr\_node@{Wickr\_node}!wickr\_node\_create\_from\_buffer@{wickr\_node\_create\_from\_buffer}}
\index{wickr\_node\_create\_from\_buffer@{wickr\_node\_create\_from\_buffer}!Wickr\_node@{Wickr\_node}}
\subsubsection{\texorpdfstring{wickr\_node\_create\_from\_buffer()}{wickr\_node\_create\_from\_buffer()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}}$\ast$ wickr\+\_\+node\+\_\+create\+\_\+from\+\_\+buffer (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}} $\ast$}]{buffer,  }\item[{const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$}]{engine }\end{DoxyParamCaption})}

Create a node from a buffer that was created with \textquotesingle{}wickr\+\_\+node\+\_\+serialize\textquotesingle{}


\begin{DoxyParams}{Parameters}
{\em buffer} & the buffer that contains a serialized representation of a node \\
\hline
{\em engine} & the crypto engine to use to import the key components of the node \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
deserialized node or null if the deserialization fails 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__node_ga6acf07885403d9df6baad36a8d797f73}\label{group__wickr__node_ga6acf07885403d9df6baad36a8d797f73}} 
\index{Wickr\_node@{Wickr\_node}!wickr\_node\_destroy@{wickr\_node\_destroy}}
\index{wickr\_node\_destroy@{wickr\_node\_destroy}!Wickr\_node@{Wickr\_node}}
\subsubsection{\texorpdfstring{wickr\_node\_destroy()}{wickr\_node\_destroy()}}
{\footnotesize\ttfamily void wickr\+\_\+node\+\_\+destroy (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$$\ast$}]{node }\end{DoxyParamCaption})}

Destroy a node


\begin{DoxyParams}{Parameters}
{\em node} & a pointer to the node to destroy. All properties of \textquotesingle{}$\ast$node\textquotesingle{} will also be destroyed \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{group__wickr__node_ga2ed650b947df7316cf0f915805ac5aa4}\label{group__wickr__node_ga2ed650b947df7316cf0f915805ac5aa4}} 
\index{Wickr\_node@{Wickr\_node}!wickr\_node\_rotate\_keypair@{wickr\_node\_rotate\_keypair}}
\index{wickr\_node\_rotate\_keypair@{wickr\_node\_rotate\_keypair}!Wickr\_node@{Wickr\_node}}
\subsubsection{\texorpdfstring{wickr\_node\_rotate\_keypair()}{wickr\_node\_rotate\_keypair()}}
{\footnotesize\ttfamily bool wickr\+\_\+node\+\_\+rotate\+\_\+keypair (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$}]{node,  }\item[{\mbox{\hyperlink{structwickr__ephemeral__keypair}{wickr\+\_\+ephemeral\+\_\+keypair\+\_\+t}} $\ast$}]{new\+\_\+keypair,  }\item[{bool}]{copy }\end{DoxyParamCaption})}

Rotate in a new ephemeral key pair for message sending

N\+O\+TE\+: This function D\+O\+ES N\+OT ensure that new\+\_\+keypair is signed properly. To do that, you must call \textquotesingle{}wickr\+\_\+node\+\_\+verify\+\_\+signature\+\_\+chain\textquotesingle{} after rotation


\begin{DoxyParams}{Parameters}
{\em node} & the node to rotate \textquotesingle{}new\+\_\+keypair\textquotesingle{} into \\
\hline
{\em new\+\_\+keypair} & the key pair to rotate into place \\
\hline
{\em copy} & if true, perform a deep copy of \textquotesingle{}new\+\_\+keypair\textquotesingle{} before rotating \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if the rotation succeeds, false if the copy fails 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__node_ga6012a4fe980b1a616369cbc4b0a95f74}\label{group__wickr__node_ga6012a4fe980b1a616369cbc4b0a95f74}} 
\index{Wickr\_node@{Wickr\_node}!wickr\_node\_serialize@{wickr\_node\_serialize}}
\index{wickr\_node\_serialize@{wickr\_node\_serialize}!Wickr\_node@{Wickr\_node}}
\subsubsection{\texorpdfstring{wickr\_node\_serialize()}{wickr\_node\_serialize()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}}$\ast$ wickr\+\_\+node\+\_\+serialize (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$}]{node }\end{DoxyParamCaption})}

Serialize a node to bytes


\begin{DoxyParams}{Parameters}
{\em node} & the node to serialize \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a buffer containing a serialized representation of \textquotesingle{}node\textquotesingle{} or null if serialization fails 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__node_gac9e2d96e9109590124b2fd05a8826c1d}\label{group__wickr__node_gac9e2d96e9109590124b2fd05a8826c1d}} 
\index{Wickr\_node@{Wickr\_node}!wickr\_node\_verify\_signature\_chain@{wickr\_node\_verify\_signature\_chain}}
\index{wickr\_node\_verify\_signature\_chain@{wickr\_node\_verify\_signature\_chain}!Wickr\_node@{Wickr\_node}}
\subsubsection{\texorpdfstring{wickr\_node\_verify\_signature\_chain()}{wickr\_node\_verify\_signature\_chain()}}
{\footnotesize\ttfamily bool wickr\+\_\+node\+\_\+verify\+\_\+signature\+\_\+chain (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structwickr__node}{wickr\+\_\+node\+\_\+t}} $\ast$}]{node,  }\item[{const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$}]{engine }\end{DoxyParamCaption})}

Verify the integrity of the signature chain for a node

In order to be valid, the ephemeral keypair\textquotesingle{}s signature must validate with the id\+\_\+chain\textquotesingle{}s \textquotesingle{}node\textquotesingle{} public signing key. The id\+\_\+chain\textquotesingle{}s \textquotesingle{}node\textquotesingle{} signature must validate with the id\+\_\+chain\textquotesingle{}s \textquotesingle{}root\textquotesingle{} public signing key


\begin{DoxyParams}{Parameters}
{\em node} & the node to verify \\
\hline
{\em engine} & a crypto engine capable of verifying EC signatures \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if the chain validates, false if there are any signature validation failures 
\end{DoxyReturn}
